<?php

/**
 * @author Nguyen Thai Binh
 */

if (!defined('BASEPATH'))
  exit('No direct script access allowed');

class Index extends CI_Controller {

  public function __construct() {
    parent::__construct();
    set_userdata('currentURL',  current_url());
    if (!userdata('username')) {
      redirect('admin/login');
    }
  }
  
  public function index() {    
    $this->output->cache($this->setting_model->item('cache_expire_time'));
//    $this->db->cache_on();
    $this->db->order_by('created_on', 'desc');
    $recent_users = $this->db->get(DB_TABLE_USER, 5, 0 )->result();
    $this->load->view('admin/index', array('recent_users' => $recent_users));
  }

}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */